package com.mes.schedule.manager.iface;


import java.util.List;

import com.mes.common.manager.iface.IBasicManager;
import com.mes.schedule.domain.SOperationLink;
import com.mes.schedule.domain.SOperationTask;
import com.mes.schedule.domain.SVirtualLink;
import com.mes.schedule.domain.ScheduleScheme;


public interface IScheduleLinkManager extends IBasicManager{	
	
	public void deleteLink(SOperationLink sLink);
	public void deletePredLink(SOperationTask so);
	public void deleteSuccLink(SOperationTask so);
	public void addLink(SOperationTask predSo,SOperationTask succSo,int linkType,int linkLag)  throws Exception;
	public void addLink(SOperationLink link)  throws Exception;	
	//public void addVirtualLink(SOperationTask predSo,SOperationTask succSo,int linkType,int linkLag)  throws Exception;
	public  void cycleLinkCheck(SOperationTask predTask,SOperationTask succTask) throws Exception;
	public long calPSLag(SOperationLink link);
	public long calPSLagMinutes(SOperationLink link);
	public void saveLink(ScheduleScheme scheme, List<SOperationLink> slinkList) throws Exception;
	public void saveVirtualLink(ScheduleScheme scheme, List<SVirtualLink> slinkList) throws Exception;
	public void updateLink(ScheduleScheme scheme,SOperationLink newLink);
	public List<SOperationLink> getPartOperationLink(ScheduleScheme scheme,String partTaskUid) throws Exception;
	public List<SOperationLink> getDeviceOperationLink(ScheduleScheme scheme,String deviceUid) throws Exception;
	/**
	 * 取得装配齐套链接
	 * @param scheme
	 * @param taskUid
	 * @return
	 * @throws Exception
	 */
	public List<SOperationLink> getAssembleLink(ScheduleScheme scheme,String taskUid) throws Exception;
		
	public  boolean isPredTask(SOperationTask predTask,SOperationTask succTask) throws Exception;
	/**
	 * 添加虚拟链接
	 * @param link
	 * @throws Exception
	 */
	void addVirtualLink(SVirtualLink link) throws Exception;
	public SOperationLink getLink(ScheduleScheme scheme, SOperationTask predSo, SOperationTask succSo);
	/**
	 * 计算流水加工下的延迟
	 * @param link
	 * @return
	 */
	public long calFlowLag(SOperationLink link);
	public long calFlowLagMinutes(SOperationLink link);
	public SOperationLink getLink(ScheduleScheme scheme, String predSoUid, String succSoUid);
}
